import request from "@/utils/request";

// 新增
export function addCategoryAPI(data) {
    return request({
        url: "/system/category",
        method: "post",
        data: data,
    });
}
// 修改
export function updateCategory(data) {
    return request({
        url: "/system/category",
        method: "put",
        data: data,
    });
}
// 分类列表
export const getCategoryListAPI = (query) => {
    return request({
        url: "/system/category/list",
        method: "get",
        params: query,
    });
};

// 删除商品分类
export function deleteCategoryAPI(id) {
    return request({
        url: "/system/category/" + id,
        method: "delete",
    });
}



// 新增
export function addGoodsAPI(data) {
    return request({
        url: "/system/goods",
        method: "post",
        data: data,
    });
}
// 修改
export function updateGoods(data) {
    return request({
        url: "/system/goods",
        method: "put",
        data: data,
    });
}
// 分类列表
export const getGoodsListAPI = (query) => {
    return request({
        url: "/system/goods/list",
        method: "get",
        params: query,
    });
};

// 删除商品分类
export function deleteGoodsAPI(id) {
    return request({
        url: "/system/goods/" + id,
        method: "delete",
    });
}

export function getGoodsDetailList(Id) {
    return request({
        url: "/system/goods/" + Id,
        method: "get",
    });
}
export const systemGoodsAPI = (query) => {
    return request({
        url: "system/goods/" + query.goodsId + "/" + query.storeId,
        method: "get",
    });
};